<template>
	<view>
		<image src="../../static/w4.jpg" class="box1"></image>
		<button class="btn" @click="loginBtn">点击登录</button>
	</view>
</template>

<script>
	import {baseUrl}  from '@/utils/utils.js'
	export default {
		data() {
			return {

			}
		},
		onLoad() {
			if(uni.getStorageSync('infor')){
				uni.switchTab({
				    url: '/pages/index/index'
				})
				}
		},
		methods: {
			//点击
			loginBtn(){
					uni.getUserProfile({
									desc:'登录',
									success:(res)=>{								
										// console.log(res);
									uni.setStorageSync('infor',res.userInfo)
									uni.switchTab({
									    url: '/pages/index/index'
									})
									}
								})
				 
				  }
			
			}

	}
</script>

<style>
	page,
	.box1,
	view {
		width: 100%;
		height: 100%;
	}

	.btn {
		position: fixed;
		left: 50%;
		bottom: 20px;
		width: 150px;
		margin-left: -75px;
		background-color: #41A863;
		color: #fff;
	}
</style>
